import SwiftUI

struct SimpleTableView: View {
    @State private var selection = 0

    var body: some View {
        NavigationView {
            TabView(selection: $selection) {
                HomeListView()
                .tabItem {
                    Image(systemName: "house.fill")
                    Text("Home")
                }
                .tag(0) // 设置item的tag值

                NavigationView{//NavigationView带导航栏
                    HomeListView()
                }
                .tabItem {
                        Image(systemName: "bookmark.circle.fill")
                        Text("Bookmark")
                    }
                    .tag(1)

                HomeTapListView()
                    .tabItem {
                        Image(systemName: "video.circle.fill")
                        Text("Video")
                    }
                    .tag(2)

                Text("Profile Tab")
                    .font(.system(size: 30, weight: .bold, design: .rounded))
                    .tabItem {
                        Image(systemName: "person.crop.circle")
                        Text("Profile")
                    }
                    .tag(3)
            }
            .accentColor(.red)
            .navigationBarTitle("TabView Demo")
        }
    }
}
//#Preview {
//    SimpleTableView()
//}


struct SimpleTableView_Previews: PreviewProvider {
    static var previews: some View {
        SimpleTableView()
    }
}
